import { OnInit } from "@angular/core";
import { Component } from "@angular/core";
import { Config } from "./service/config";
@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"]
})
export class AppComponent implements OnInit {
  title = "app";
  config: any = Config;

  ngOnInit() {

    if ((window.location.href + "").indexOf("localhost") >= 0) {
      this.config.IP = "http://localhost:8099/";
      this.config.PREVIEW_URL = "http://www.hyjckj.net:8080/upload/";
    }
    if ((window.location.href + "").indexOf("www.hyjckj.net") >= 0) {
      this.config.IP = "https://www.hyjckj.net:443/";
      this.config.PREVIEW_URL = "http://www.hyjckj.net:8080/upload/";
    }
    if ((window.location.href + "").indexOf("wzscjg.hyjckj.net") >= 0) {
      this.config.IP = "https://wzscjg.hyjckj.net:8443/";
      this.config.PREVIEW_URL = "http://wzscjg.hyjckj.net:8668/upload/";
    }
    if ((window.location.href + "").indexOf("yhtscjg.hyjckj.net") >= 0) {
      this.config.IP = "https://yhtscjg.hyjckj.net:8443/";
      this.config.PREVIEW_URL = "http://yhtscjg.hyjckj.net:8668/upload/";
    }
    if ((window.location.href + "").indexOf("pdscjg.hyjckj.net") >= 0) {
      this.config.IP = "https://pdscjg.hyjckj.net:8443/";
      this.config.PREVIEW_URL = "http://pdscjg.hyjckj.net:8668/upload/";
    }
    if ((window.location.href + "").indexOf("dtwzh.szqts.gov.cn") >= 0) {
      this.config.IP = "https://dtwzh.szqts.gov.cn:443/";
      this.config.PREVIEW_URL = "http://58.210.227.48:8066/upload/";
    }
    if ((window.location.href + "").indexOf("pkscjg.hyjckj.net") >= 0) {
      this.config.IP = "https://pkscjg.hyjckj.net:443/";
      this.config.PREVIEW_URL = "http://pkscjg.hyjckj.net:8668/upload/";
    }
  }
}
